
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>django.contrib.gis.feeds &#8212; Django 1.11.22.dev20190603194737 documentation</title>
    <link rel="stylesheet" href="../../../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../../../../" src="../../../../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../../../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../search.html" />



 
<script type="text/javascript" src="../../../../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../../../../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);
</script>


  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../../../index.html">Django 1.11.22.dev20190603194737 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../../../index.html">Home</a>  |
        <a title="Table of contents" href="../../../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../../../genindex.html">Index</a>  |
        <a title="Module index" href="../../../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    <a href="../../../index.html" title="Module code" accesskey="U">up</a></div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="_modules-django-contrib-gis-feeds">
            
  <h1>Source code for django.contrib.gis.feeds</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">unicode_literals</span>

<span class="kn">from</span> <span class="nn">django.contrib.syndication.views</span> <span class="k">import</span> <span class="n">Feed</span> <span class="k">as</span> <span class="n">BaseFeed</span>
<span class="kn">from</span> <span class="nn">django.utils.feedgenerator</span> <span class="k">import</span> <span class="n">Atom1Feed</span><span class="p">,</span> <span class="n">Rss201rev2Feed</span>


<span class="k">class</span> <span class="nc">GeoFeedMixin</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    This mixin provides the necessary routines for SyndicationFeed subclasses</span>
<span class="sd">    to produce simple GeoRSS or W3C Geo elements.</span>
<span class="sd">    &quot;&quot;&quot;</span>

    <span class="k">def</span> <span class="nf">georss_coords</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">coords</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        In GeoRSS coordinate pairs are ordered by lat/lon and separated by</span>
<span class="sd">        a single white space.  Given a tuple of coordinates, this will return</span>
<span class="sd">        a unicode GeoRSS representation.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">return</span> <span class="s1">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="s1">&#39;</span><span class="si">%f</span><span class="s1"> </span><span class="si">%f</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">coord</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">coord</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="k">for</span> <span class="n">coord</span> <span class="ow">in</span> <span class="n">coords</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">add_georss_point</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">coords</span><span class="p">,</span> <span class="n">w3c_geo</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        Adds a GeoRSS point with the given coords using the given handler.</span>
<span class="sd">        Handles the differences between simple GeoRSS and the more popular</span>
<span class="sd">        W3C Geo specification.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="k">if</span> <span class="n">w3c_geo</span><span class="p">:</span>
            <span class="n">lon</span><span class="p">,</span> <span class="n">lat</span> <span class="o">=</span> <span class="n">coords</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span>
            <span class="n">handler</span><span class="o">.</span><span class="n">addQuickElement</span><span class="p">(</span><span class="s1">&#39;geo:lat&#39;</span><span class="p">,</span> <span class="s1">&#39;</span><span class="si">%f</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">lat</span><span class="p">)</span>
            <span class="n">handler</span><span class="o">.</span><span class="n">addQuickElement</span><span class="p">(</span><span class="s1">&#39;geo:lon&#39;</span><span class="p">,</span> <span class="s1">&#39;</span><span class="si">%f</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">lon</span><span class="p">)</span>
        <span class="k">else</span><span class="p">:</span>
            <span class="n">handler</span><span class="o">.</span><span class="n">addQuickElement</span><span class="p">(</span><span class="s1">&#39;georss:point&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">georss_coords</span><span class="p">((</span><span class="n">coords</span><span class="p">,)))</span>

    <span class="k">def</span> <span class="nf">add_georss_element</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">w3c_geo</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
        <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        This routine adds a GeoRSS XML element using the given item and handler.</span>
<span class="sd">        &quot;&quot;&quot;</span>
        <span class="c1"># Getting the Geometry object.</span>
        <span class="n">geom</span> <span class="o">=</span> <span class="n">item</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;geometry&#39;</span><span class="p">)</span>
        <span class="k">if</span> <span class="n">geom</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
            <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">geom</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">)):</span>
                <span class="c1"># Special case if a tuple/list was passed in.  The tuple may be</span>
                <span class="c1"># a point or a box</span>
                <span class="n">box_coords</span> <span class="o">=</span> <span class="kc">None</span>
                <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">geom</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">)):</span>
                    <span class="c1"># Box: ( (X0, Y0), (X1, Y1) )</span>
                    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">geom</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
                        <span class="n">box_coords</span> <span class="o">=</span> <span class="n">geom</span>
                    <span class="k">else</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Only should be two sets of coordinates.&#39;</span><span class="p">)</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">geom</span><span class="p">)</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
                        <span class="c1"># Point: (X, Y)</span>
                        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_point</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">geom</span><span class="p">,</span> <span class="n">w3c_geo</span><span class="o">=</span><span class="n">w3c_geo</span><span class="p">)</span>
                    <span class="k">elif</span> <span class="nb">len</span><span class="p">(</span><span class="n">geom</span><span class="p">)</span> <span class="o">==</span> <span class="mi">4</span><span class="p">:</span>
                        <span class="c1"># Box: (X0, Y0, X1, Y1)</span>
                        <span class="n">box_coords</span> <span class="o">=</span> <span class="p">(</span><span class="n">geom</span><span class="p">[:</span><span class="mi">2</span><span class="p">],</span> <span class="n">geom</span><span class="p">[</span><span class="mi">2</span><span class="p">:])</span>
                    <span class="k">else</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Only should be 2 or 4 numeric elements.&#39;</span><span class="p">)</span>
                <span class="c1"># If a GeoRSS box was given via tuple.</span>
                <span class="k">if</span> <span class="n">box_coords</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">w3c_geo</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Cannot use simple GeoRSS box in W3C Geo feeds.&#39;</span><span class="p">)</span>
                    <span class="n">handler</span><span class="o">.</span><span class="n">addQuickElement</span><span class="p">(</span><span class="s1">&#39;georss:box&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">georss_coords</span><span class="p">(</span><span class="n">box_coords</span><span class="p">))</span>
            <span class="k">else</span><span class="p">:</span>
                <span class="c1"># Getting the lower-case geometry type.</span>
                <span class="n">gtype</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">geom</span><span class="o">.</span><span class="n">geom_type</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
                <span class="k">if</span> <span class="n">gtype</span> <span class="o">==</span> <span class="s1">&#39;point&#39;</span><span class="p">:</span>
                    <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_point</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">geom</span><span class="o">.</span><span class="n">coords</span><span class="p">,</span> <span class="n">w3c_geo</span><span class="o">=</span><span class="n">w3c_geo</span><span class="p">)</span>
                <span class="k">else</span><span class="p">:</span>
                    <span class="k">if</span> <span class="n">w3c_geo</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;W3C Geo only supports Point geometries.&#39;</span><span class="p">)</span>
                    <span class="c1"># For formatting consistent w/the GeoRSS simple standard:</span>
                    <span class="c1"># http://georss.org/1.0#simple</span>
                    <span class="k">if</span> <span class="n">gtype</span> <span class="ow">in</span> <span class="p">(</span><span class="s1">&#39;linestring&#39;</span><span class="p">,</span> <span class="s1">&#39;linearring&#39;</span><span class="p">):</span>
                        <span class="n">handler</span><span class="o">.</span><span class="n">addQuickElement</span><span class="p">(</span><span class="s1">&#39;georss:line&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">georss_coords</span><span class="p">(</span><span class="n">geom</span><span class="o">.</span><span class="n">coords</span><span class="p">))</span>
                    <span class="k">elif</span> <span class="n">gtype</span> <span class="ow">in</span> <span class="p">(</span><span class="s1">&#39;polygon&#39;</span><span class="p">,):</span>
                        <span class="c1"># Only support the exterior ring.</span>
                        <span class="n">handler</span><span class="o">.</span><span class="n">addQuickElement</span><span class="p">(</span><span class="s1">&#39;georss:polygon&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">georss_coords</span><span class="p">(</span><span class="n">geom</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">coords</span><span class="p">))</span>
                    <span class="k">else</span><span class="p">:</span>
                        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">&#39;Geometry type &quot;</span><span class="si">%s</span><span class="s1">&quot; not supported.&#39;</span> <span class="o">%</span> <span class="n">geom</span><span class="o">.</span><span class="n">geom_type</span><span class="p">)</span>


<span class="c1"># ### SyndicationFeed subclasses ###</span>
<div class="viewcode-block" id="GeoRSSFeed"><a class="viewcode-back" href="../../../../ref/contrib/gis/feeds.html#django.contrib.gis.feeds.GeoRSSFeed">[docs]</a><span class="k">class</span> <span class="nc">GeoRSSFeed</span><span class="p">(</span><span class="n">Rss201rev2Feed</span><span class="p">,</span> <span class="n">GeoFeedMixin</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">rss_attributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">attrs</span> <span class="o">=</span> <span class="nb">super</span><span class="p">(</span><span class="n">GeoRSSFeed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">rss_attributes</span><span class="p">()</span>
        <span class="n">attrs</span><span class="p">[</span><span class="s1">&#39;xmlns:georss&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;http://www.georss.org/georss&#39;</span>
        <span class="k">return</span> <span class="n">attrs</span>

    <span class="k">def</span> <span class="nf">add_item_elements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">GeoRSSFeed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">add_item_elements</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_element</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">add_root_elements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">GeoRSSFeed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">add_root_elements</span><span class="p">(</span><span class="n">handler</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_element</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">feed</span><span class="p">)</span></div>


<div class="viewcode-block" id="GeoAtom1Feed"><a class="viewcode-back" href="../../../../ref/contrib/gis/feeds.html#django.contrib.gis.feeds.GeoAtom1Feed">[docs]</a><span class="k">class</span> <span class="nc">GeoAtom1Feed</span><span class="p">(</span><span class="n">Atom1Feed</span><span class="p">,</span> <span class="n">GeoFeedMixin</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">root_attributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">attrs</span> <span class="o">=</span> <span class="nb">super</span><span class="p">(</span><span class="n">GeoAtom1Feed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">root_attributes</span><span class="p">()</span>
        <span class="n">attrs</span><span class="p">[</span><span class="s1">&#39;xmlns:georss&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;http://www.georss.org/georss&#39;</span>
        <span class="k">return</span> <span class="n">attrs</span>

    <span class="k">def</span> <span class="nf">add_item_elements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">GeoAtom1Feed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">add_item_elements</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_element</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">add_root_elements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">GeoAtom1Feed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">add_root_elements</span><span class="p">(</span><span class="n">handler</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_element</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">feed</span><span class="p">)</span></div>


<div class="viewcode-block" id="W3CGeoFeed"><a class="viewcode-back" href="../../../../ref/contrib/gis/feeds.html#django.contrib.gis.feeds.W3CGeoFeed">[docs]</a><span class="k">class</span> <span class="nc">W3CGeoFeed</span><span class="p">(</span><span class="n">Rss201rev2Feed</span><span class="p">,</span> <span class="n">GeoFeedMixin</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">rss_attributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="n">attrs</span> <span class="o">=</span> <span class="nb">super</span><span class="p">(</span><span class="n">W3CGeoFeed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">rss_attributes</span><span class="p">()</span>
        <span class="n">attrs</span><span class="p">[</span><span class="s1">&#39;xmlns:geo&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;http://www.w3.org/2003/01/geo/wgs84_pos#&#39;</span>
        <span class="k">return</span> <span class="n">attrs</span>

    <span class="k">def</span> <span class="nf">add_item_elements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">W3CGeoFeed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">add_item_elements</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_element</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">w3c_geo</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>

    <span class="k">def</span> <span class="nf">add_root_elements</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">handler</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">(</span><span class="n">W3CGeoFeed</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">add_root_elements</span><span class="p">(</span><span class="n">handler</span><span class="p">)</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">add_georss_element</span><span class="p">(</span><span class="n">handler</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">feed</span><span class="p">,</span> <span class="n">w3c_geo</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>


<span class="c1"># ### Feed subclass ###</span>
<div class="viewcode-block" id="Feed"><a class="viewcode-back" href="../../../../ref/contrib/gis/feeds.html#django.contrib.gis.feeds.Feed">[docs]</a><span class="k">class</span> <span class="nc">Feed</span><span class="p">(</span><span class="n">BaseFeed</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    This is a subclass of the `Feed` from `django.contrib.syndication`.</span>
<span class="sd">    This allows users to define a `geometry(obj)` and/or `item_geometry(item)`</span>
<span class="sd">    methods on their own subclasses so that geo-referenced information may</span>
<span class="sd">    placed in the feed.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">feed_type</span> <span class="o">=</span> <span class="n">GeoRSSFeed</span>

    <span class="k">def</span> <span class="nf">feed_extra_kwargs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
        <span class="k">return</span> <span class="p">{</span><span class="s1">&#39;geometry&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_dynamic_attr</span><span class="p">(</span><span class="s1">&#39;geometry&#39;</span><span class="p">,</span> <span class="n">obj</span><span class="p">)}</span>

    <span class="k">def</span> <span class="nf">item_extra_kwargs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
        <span class="k">return</span> <span class="p">{</span><span class="s1">&#39;geometry&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_dynamic_attr</span><span class="p">(</span><span class="s1">&#39;item_geometry&#39;</span><span class="p">,</span> <span class="n">item</span><span class="p">)}</span></div>
</pre></div>

          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Jun 03, 2019</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    <a href="../../../index.html" title="Module code" accesskey="U">up</a></div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>